#ifndef __WK_USART_H
#define __WK_USART_H

#ifdef __cplusplus
extern "C" {
#endif


#include "at32f403a_407_wk_config.h"
#include "stdio.h"

/* init usart1 function. */
#define UART1_RX_BUFFER_SIZE            512
#define UART1_TX_BUFFER_SIZE            512

extern uint8_t uart1_rx_buffer[UART1_RX_BUFFER_SIZE];
extern uint8_t uart1_tx_buffer[UART1_TX_BUFFER_SIZE];

extern volatile uint32_t rx1_count;
extern volatile uint32_t rx1_flag;

void wk_usart1_init(void);
void uart1_send_bytes(const uint8_t *byte, uint32_t len);


/* init uart5 function. */
#define UART5_RX_BUFFER_SIZE            512
#define UART5_TX_BUFFER_SIZE            512

extern uint8_t uart5_rx_buffer[UART5_RX_BUFFER_SIZE];
extern uint8_t uart5_tx_buffer[UART5_TX_BUFFER_SIZE];

extern volatile uint32_t rx5_count;
extern volatile uint32_t rx5_flag;

void wk_uart5_init(void);
void uart5_send_bytes(const uint8_t *byte, uint32_t len);
void uart1_dma_send_bytes(const uint8_t *byte, uint32_t len);
void uart5_dma_send_bytes(const uint8_t *byte, uint32_t len);






#ifdef __cplusplus
}
#endif

#endif
